package com.tyc.threadlocal;

/**
 * 父子线程传递数据
 *
 * @author tyc
 * @version 1.0
 * @date 2023-01-11 15:30:41
 */
public class InheritableThreadLocalTest {
    public static void main(String[] args) {
        final ThreadLocal<String> threadLocal = new InheritableThreadLocal<>();
        threadLocal.set("main");
        new Thread(()->{
            System.out.println(threadLocal.get());
        }).start();
    }
}
